package com.cn.springcloudvaccine.utils.commen;

import org.apache.log4j.Logger;

import java.io.PrintWriter;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 帮助类
 * 
 * @author : D.yaping
 * @address : 宁夏纵横宝盈成都研发中心
 * @time : 2016-8-1
 * @version : 1.0.0
 */
public class LogUtils {
	// 日志对象
	static Logger logger = Logger.getLogger(LogUtils.class);
	// 时间格式转换对象
	static SimpleDateFormat formate = new SimpleDateFormat("yyyyMMdd HH:mm:ss");
	/**
	 * 打印普通信息
	 * @param content
	 */
	public static void writeLog(String content){
		System.out.println(formate.format(new Date()) + "- -" + content);
	}
	/**
	 * 打印调试信息
	 * @param content
	 */
	public static void writeDebugLog(String content){
		System.out.println(formate.format(new Date()) + "- -" + content);
	}
	/**
	 * 向前端传送值
	 * @param out
	 * @param result
	 */
	public static void writeFlushResult(PrintWriter out,String result){
		out.write(result.toString());
		out.flush();
		out.close();
		writeDebugLog( "输出前台日志- -" + result);
	}
}
